<template>
  <card :filter="true">
    <template v-slot:header>
      <CalendarSettingButton ref="Header" @add="addEvent" @del="onDel" />
    </template>
    <template v-slot:filter>
      <CalendarSettingSearch ref="FilterTool" @search="searchEvent" />
    </template>
    <div class="staff-table">
      <CalendarSettingTableArea ref="TableArea" />
    </div>
    <CalendarSettingDialog ref="Add" @refresh="refreshEvent" />
  </card>
</template>
<script>
import CalendarSettingButton from './components/CalendarSettingButton'
import CalendarSettingDialog from './components/CalendarSettingDialog'
import CalendarSettingSearch from './components/CalendarSettingSearch'
import CalendarSettingTableArea from './components/CalendarSettingTableArea'
export default {
  name: 'Setup',
  components: { CalendarSettingButton, CalendarSettingDialog, CalendarSettingSearch, CalendarSettingTableArea },
  data() {
    return {
      rowData: ''
    }
  },
  methods: {
    addEvent() {
      this.$refs.Add.title = '新增'
      this.$refs.Add.lngfundsourceid = ''
      this.$refs.Add.show()
    },
    editEvent(row) {
      console.log(row, '编辑')
      this.$refs.Add.title = '编辑'
      this.$refs.Add.lngfundsourceid = row.lngfundsourceid
      this.$refs.Add.show()
    },
    refreshEvent() {
      this.$refs['TableArea'].queryListByPage()
      this.$refs['FilterTool'].getYearList()
    },
    searchEvent(val) {
      this.$refs.TableArea.queryListByPage(val)
      this.$refs.TableArea.searchForm = val
    },
    onDel() {
      this.$refs['FilterTool'].onDel()
    }
  }
}
</script>

